package com.taylor.seckill.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description: TODO
 * @author taylor
 * @date  2021/4/9 0:11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseBean {
    private long code;
    private String message;
    private Object obj;

    public static ResponseBean success(){
        return new ResponseBean(ResponseBeanEnum.SUCCESS.getCode(),ResponseBeanEnum.SUCCESS.getMessage(),null);

    }

    public static ResponseBean success(Object obj){
        return new ResponseBean(ResponseBeanEnum.SUCCESS.getCode(),ResponseBeanEnum.SUCCESS.getMessage(),obj);

    }

    public static ResponseBean error(){
        return new ResponseBean(ResponseBeanEnum.ERROR.getCode(),ResponseBeanEnum.ERROR.getMessage(),null);

    }

    public static ResponseBean error(Object obj){
        return new ResponseBean(ResponseBeanEnum.ERROR.getCode(),ResponseBeanEnum.ERROR.getMessage(),obj);

    }
}
